package org.dtrd.modules.content.tags.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.content.tags.entity.bean.TagsDetail;

import java.util.Date;


/**
 * <p>
 * 标签
 * </p>
 *
 * @author QR
 * @since 2022-03-15
 */
@Getter
@Setter
@TableName("dtrd_ext_ems_yw_tags")
public class DtrdExtEmsYwTags {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    @TableField("is_del")
    @TableLogic
    private Integer isDel;

    /**
     * 标签名称
     */
    @TableField("tag_name")
    private String tagName;

    /**
     * 所属内容Id
     */
    @TableField("tag_contentId")
    private Integer tagContentid;

    /**
     * 所属分类：1-常见问题，2-食材，3-食谱，4-菜谱，5-药品，6-宜忌速查，7-专业词汇，8-小贴士，9-医生版知识库，10-用户版知识库
     */
    @TableField("tag_type")
    private Integer tagType;

    /**
     * 创建时间
     */
    @TableField("tag_create_time")
    private Date tagCreateTime;

    /**
     * 标签热度
     */
    @TableField("tag_hot")
    private Integer tagHot;

    public DtrdExtEmsYwTags init() {
        isDel = 0;
        tagCreateTime = new Date();
        return this;
    }

    public DtrdExtEmsYwTags parseFromDTO(TagsDetail dto) {
        dataId = dto.getTagId();
        tagName = dto.getTagName();
        tagType = dto.getTagType();
        tagHot=dto.getTagHot();
        return this;
    }


}
